package org.maylove.wuziqi.dao;

import org.maylove.wuziqi.pojo.history.History;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HistoryDao extends JpaRepository<History, Long> {
    @Query("SELECT h FROM History h WHERE h.userId=?1 ORDER BY h.historyId DESC")
    List<History> getHistory(Long userId);
}
